<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>flex</title>
</head>

    <style>
        .box {
            display: flex;
            flex-wrap: wrap;
            /* 容器内必须有多行的项目，该属性才能渲染出效果 */
            align-content: center;
            /* justify-content: center; */
            align-items: center;
            width: 200px;
            height: 500px;
            background: gray;
            margin: auto;
        }

        .item1 {
            width: 100px;
            height: 100px;
            background: red;
        }
        .item2{
            width: 100px;
            height: 100px;
            background: green;
        }
        .item3 {
            width: 100px;
            height: 100px;
            background: blue;
            /* align-self: stretch; */
        }
    </style>

<body>

    <div class="box">
        <div class="item1">1</div>
        <div class="item2">2</div>
        <div class="item3">3</div>
    </div>
    
</body>
</html>